package com.dao;

import com.domain.Space;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("spaceDao")
public interface SpaceDao {

     List<Space> selectSpaceAll();

     List<Space> selectSpaceByUserId(Integer userId);

     Space selectSpaceByNameAndUserId(@Param("name") String name,@Param("userId") Integer userId);

     Space selectSpaceByIdAndUserId(@Param("id") Integer id,@Param("userId") Integer userId);

     Space selectSpaceByName(@Param("name") String name);

     Space selectSpaceById(@Param("id") Integer id );

     List<Space> descCreateDate();

     Space descCreateDateByUserId(@Param("userId") Integer userId);

     int insertSpace(Space space);

     int deleteById(Integer id);

     int deleteByUserId(@Param("id") Integer id, @Param("userId") Integer userId);

     int updateSpaceById(Space space);

     /*****************************************************************/

     int selectUserIdBySpaceId(int id);

     List<Space> findAllSpace(@Param("from") int page, @Param("pageSize") int pageSize);

     int findSpaceTotal();

}
